package com.quzi.kettle;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.acra.annotation.ReportsCrashes;

import com.tencent.mm.sdk.openapi.IWXAPI;
import com.tencent.mm.sdk.openapi.WXAPIFactory;

import android.app.Activity;
import android.app.Application;

@ReportsCrashes(formKey = "", mailTo = "jchung@quzitech.com")
public class MyApplication extends Application {

	public final static String url = "http://kettle.qiweiglobal.com:8001/api/";
	public static final String record = "RECORD";
	public final static String imageUrl = "http://kettle.qiweiglobal.com:8001";

	public final static int USER_LOGIN = 0;
	public final static int USER_REGISTER = 1;
	public final static int USER_GETCODE = 3;
	public final static int USER_UPDATEPASSWORD = 4;
	public final static int USER_ICON = 5;
	public final static int USER_FORGETPASSPSW = 6;

	public final static int DEVICE_LIST = 7;
	public final static int DEVICE_BIND = 8;
	public final static int DEVICE_UNBIND = 9;
	public final static int DATA_ANALYZE = 10;
	public final static int USER_INFO = 11;

	public final static int HEALTH_INFO = 12;

	public final static int UPDATE_INFO = 13;

	public static Map<Integer, String> requestMap = new HashMap<Integer, String>();
	public static Map<String, String> header;

	public static String RECORD;
	public static String UUID;

	static {
		requestMap.put(USER_LOGIN, "user/login");
		requestMap.put(USER_REGISTER, "user/register");
		requestMap.put(USER_GETCODE, "code/send");
		requestMap.put(USER_UPDATEPASSWORD, "user/updatepassword");
		requestMap.put(USER_ICON, "user/icon");
		requestMap.put(USER_FORGETPASSPSW, "user/forgetpsw");
		requestMap.put(USER_INFO, "user/info");

		requestMap.put(DEVICE_LIST, "device/list");
		requestMap.put(DEVICE_BIND, "device/bind");
		requestMap.put(DEVICE_UNBIND, "device/unbind");
		requestMap.put(DATA_ANALYZE, "data/analyze");

		requestMap.put(HEALTH_INFO, "article/list");

		requestMap.put(UPDATE_INFO, "app/updateinfo");

	}
	private static final String APP_ID = "ssefasfsae";
	private static IWXAPI api;

	private void regToWx() {
		api = WXAPIFactory.createWXAPI(getApplicationContext(), APP_ID, true);
		api.registerApp(APP_ID);
	}

	public static IWXAPI getApi() {
		return api;
	}

	@Override
	public void onCreate() {
		// TODO Auto-generated method stub
		super.onCreate();
		regToWx();
	}

}